package com.delicious.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.delicious.dao.impl.FoodsDaoImpl;
import com.delicious.entity.Foods;

public class FoodsDetailsServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		int id = Integer.parseInt(request.getParameter("id"));
		Foods foods = new FoodsDaoImpl().getFoodByID(id);
		
		request.setAttribute("food", foods);
		
		request.getRequestDispatcher("details.jsp").forward(request, response);
	}

}
